﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace GroupChat2013.Common
{
    /// <summary>
    /// 扩展方法,简化代码
    /// </summary>
    public static class MethodEx
    {
        /// <summary>
        /// 把数组转换为List
        /// </summary>
        /// <typeparam name="T">参数类型</typeparam>
        /// <param name="source">数据</param>
        /// <returns>返回数据</returns>
        public static List<T> ToList<T>(T[] source)
        {
            List<T> files = new List<T>();
            for (int i = 0; i < source.Length; i++)
            {
                files.Add(source[i]);
            }

            return files;
        }
    }
}
